<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * 权限管理
     */
    public function up(): void
    {
        Schema::create('grantfunction', function (Blueprint $table) {
            $table->charset = 'utf8mb4';
            $table->collation = 'utf8mb4_unicode_ci';
            $table->id();
            $table->string('menuid', 50)->nullable();
            $table->string('roleid', 50)->nullable();
            $table->string('channelids', 200)->nullable();
            $table->text('functionlist');
            $table->string('des', 200)->nullable();
            $table->string('tabnm', 50)->nullable();
            $table->string('modifier', 50)->nullable();
            $table->integer('isdel')->nullable()->default(0);
            $table->timestamp('updated_at')->default(DB::raw('CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP'));
            $table->timestamp('created_at')->nullable();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('grantfunction');
    }
};
